//
// Created by WangPeng on 24-8-19.
//

#ifndef RTSP_H264_SERVER_AAC_FILE_H
#define RTSP_H264_SERVER_AAC_FILE_H

#include <cstdint>
#include "abstract_interface.h"

struct RtpPacket;
class CAACFile : public CAbstractInterface
{
public:
    explicit CAACFile(std::string file_name);
    ~CAACFile() override;
    long get_frame_data(char *&frame, long size) override;
    void play(CUdpSocket* udp_socket, CRtpProtocol* rtp_protocol) override;
private:
    static int parse_adts_header(const uint8_t* input, struct adts_header* header);
    static int send_aac_stream_over_udp(CUdpSocket* udp_socket, CRtpProtocol* rtp_protocol, char *frame, std::size_t frame_size);
};

#endif //RTSP_H264_SERVER_AAC_FILE_H
